//
//  MagicUIFactory.h
//  WXReader
//
//  Created by LL on 2020/8/12.
//  Copyright © 2020 Andrew. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <YYLabel.h>

NS_ASSUME_NONNULL_BEGIN

@interface TL_UIFactory : NSObject

#pragma mark - UIView
/// 创建UIView
+ (UIView *)view;

/// 创建UIView 背景颜色 圆角
+ (UIView *)viewWithBackgroundColor:(nullable UIColor *)backgroudColor cornerRadius:(CGFloat)cornerRadius;

#pragma mark UILabel
/// 创建UILabel
+ (UILabel *)label;

/// 创建UILabel 背景颜色 字体 文本颜色
+ (UILabel *)labelWithBackgroundColor:(nullable UIColor *)backgroudColor font:(nullable UIFont *)font textColor:(nullable UIColor *)textColor;

/// 创建YYLabel
+ (YYLabel *)yylabel;

/// 创建YYLabel 背景颜色 字体 文本颜色
+ (YYLabel *)yylabelWithBackgroundColor:(nullable UIColor *)backgroudColor font:(nullable UIFont *)font textColor:(nullable UIColor *)textColor;

#pragma mark UIImageView
/// 创建UIImageView
+ (UIImageView *)imageView;

/// 创建UIImageView 背景颜色 image 圆角
+ (UIImageView *)imageViewWithBackgroundColor:(nullable UIColor *)backgroundColor image:(nullable UIImage *)image cornerRadius:(CGFloat)cornerRadius;

#pragma mark - UIControl
#pragma mark UIButton
/// 创建UIButton  目标对象  响应事件
+ (UIButton *)buttonWithTarget:(nullable id)target action:(nullable SEL)action;

/// 创建UIButtonTypeCustom  目标对象  响应事件
+ (UIButton *)buttonTypeCustomWithTarget:(nullable id)target action:(nullable SEL)action;

///创建UIButtonTypeCustom 字体  字体颜色  目标对象  响应事件
+ (UIButton *)buttonTypeCustomWithFont:(nullable UIFont *)font
                             textColor:(nullable UIColor *)textColor
                                target:(nullable id)target
                                action:(nullable SEL)action;

///创建UIButton 样式  背景颜色  字体  字体颜色  目标对象  响应事件
+ (UIButton *)buttonWithType:(UIButtonType)type backgroundColor:(nullable UIColor *)backgroudColor font:(nullable UIFont *)font textColor:(nullable UIColor *)textColor target:(nullable id)target action:(nullable SEL)action;

#pragma mark UITextField
/// 创建UITextField
+ (UITextField *)textField;

/// 创建UITextField  背景颜色  占位文字  文本颜色  字体  代理  是不是数字键盘
+ (UITextField *)textFieldWithBackgroundColor:(nullable UIColor *)backgroundColor placeholder:(nullable NSString *)placeholder textColor:(nullable UIColor *)textColor font:(nullable UIFont *)font delegate:(nullable id<UITextFieldDelegate>)delegate isNumber:(BOOL)isNumber;


#pragma mark - UIScrollView
/// 创建UIScrollView
+ (UIScrollView *)scrollView;

/// 创建UIScrollView 背景颜色 代理
+ (UIScrollView *)scrollViewWithBackgroundColor:(nullable UIColor *)backgroundColor delegate:(nullable id<UIScrollViewDelegate>)delegate;

#pragma mark UITextView
/// 创建UITextView
+ (UITextView *)textView;

/// 创建UITextView  背景颜色  代理  文本颜色  字体大小  是否可编辑
+ (UITextView *)textViewWithBackgroundColor:(nullable UIColor *)backgroundColor delegate:(nullable id<UITextViewDelegate>)delegate textColor:(nullable UIColor *)textColor font:(nullable UIFont *)font editable:(BOOL)editable;

#pragma mark UITableView
/// 创建UITableView
+ (UITableView *)tableView;

/// 创建UITableView 背景颜色 代理 cell数组
+ (UITableView *)tableViewWithBackgroundColor:(nullable UIColor *)backgroundColor delegate:(nullable id<UITableViewDataSource, UITableViewDelegate>)delegate style:(UITableViewStyle)style cellClass:(nullable NSArray<Class> *)cellClass;

#pragma mark UICollectionView
/// 创建UICollectionView layout
+ (UICollectionView *)collectionViewWithLayout:(UICollectionViewLayout *)layout;

/// 创建UICollectionView layout 背景颜色 代理 cell数组
+ (UICollectionView *)collectionViewWithLayout:(UICollectionViewLayout *)layout backgroundColor:(nullable UIColor *)backgroundColor delegate:(nullable id<UICollectionViewDataSource, UICollectionViewDelegate>)delegate cellClass:(nullable NSArray<Class> *)cellClass;

@end

NS_ASSUME_NONNULL_END
